﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Ecreate.Business;
using Ecreate.Model;
namespace Ecreate.Web.systemanage.info
{
    public partial class info : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                InfoService service = new InfoService();
                t_info info = service.getInfo();
                this.txt_message.Text = info.Message;
                this.txt_introduce.Text = info.Introduce;
                this.txt_homepagename.Text = info.Homepagename;
                this.txt_url.Text = info.Homepageurl;
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            InfoService service = new InfoService();
            t_info info = new t_info();
            info.Message = this.txt_message.Text;
            info.Introduce = this.txt_introduce.Text;
            info.Homepagename = this.txt_homepagename.Text;
            info.Homepageurl = this.txt_url.Text;
            WebResult<t_info> result=service.InsertOrUpdate(info);
            this.lbl_message.Text = result.Message;
            this.lbl_message.Visible = true;

        }


    }
}
